package com.woniu.controller;


import com.woniu.entity.Booktype;
import com.woniu.service.BooktypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author huangjianbin
 * @since 2023-02-02 08:51:05
 */
@RestController
@RequestMapping("/booktype")
public class BooktypeController {

    @Autowired
    BooktypeService booktypeService;

    @RequestMapping("all")
    public List<Booktype> all(){
        List<Booktype> allBookType = booktypeService.list();

        return allBookType;
    }
    @RequestMapping("getById")
    public Booktype getById(Integer typeId){
        Booktype booktype = booktypeService.getById(typeId);
        return booktype;
    }
}

